/**
 * Copyright: Copyright (c) 2012
 * Company:深圳市海乐淘电子商务有限公司
 * @author lifuyu
 * @date 2012-5-22 下午10:06:58
 * @version V1.0
 *
 * @Description: 系统全局的业务service
 */
package com.microcm.system.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.microcm.system.dao.SystemDao;
import com.microcm.system.entity.SysArea;
import com.microcm.system.service.SystemService;

@Service("systemService")
public class SystemServiceImpl implements SystemService
{
	@Autowired
	private SystemDao systemDao;

	/**
	 * 批量更新淘宝的省市区基础数据
	 * 
	 * @author：lifuyu
	 * @param areaList
	 * @return
	 */
	public boolean batchSaveAreas(List<SysArea> areaList)
	{
		return this.systemDao.batchAreasSave(areaList);
	}

	/**
	 * 查询所有的TAG
	 * 
	 * @return
	 */
	public List<?> queryAllTags()
	{
		return this.systemDao.queryList("system.selectAllTags", null);
	}

	/**
	 * 查询N条待索引的商品数据
	 * 
	 * @author kansum
	 */
	public List<?> queryReadyForBuildIndexGoods()
	{
		return this.systemDao.queryList("system.queryReadyForBuildIndexGoods", null);
	}

	/**
	 * 更新商品已经被索引过了
	 * 
	 * @author kansum
	 */
	public void updateGoodsHasIndex(List<?> goodsList)
	{
		this.systemDao.batchUpdateGoodsHasIndex(goodsList);
	}

	/**
	 * 查询所有待删除索引的商品数据
	 * 
	 * @author kansum
	 */
	public List<?> queryReadyForCleanIndexGoods()
	{
		return this.systemDao.queryList("system.queryReadyForCleanIndexGoods", null);
	}

	/**
	 * 删除已经清除索引的商品记录
	 * 
	 * @author kansum
	 */
	public void deleteGoodsHasCleanIndex(List<?> goodsList)
	{
		this.systemDao.batchDeleteGoodsHasCleanIndex(goodsList);
	}

	/**
	 * 查询待索引的店铺数据
	 * 
	 * @author kansum
	 */
	public List<?> queryReadyForBuildIndexShops()
	{
		return this.systemDao.queryList("system.queryReadyForBuildIndexShops", null);
	}

	/**
	 * 更新店铺已经被索引过了
	 * 
	 * @author kansum
	 */
	public void updateShopsHasIndex(List<?> shopList)
	{
		this.systemDao.batchUpdateShopsHasIndex(shopList);
	}

	/**
	 * 查询待索引的用户数据
	 * 
	 * @author kansum
	 */
	public List<?> queryReadyForBuildIndexUsers()
	{
		return this.systemDao.queryList("system.queryReadyForBuildIndexUsers", null);
	}

	/**
	 * 更新用户已经被索引过了
	 * 
	 * @author kansum
	 */
	public void updateUsersHasIndex(List<?> userList)
	{
		this.systemDao.batchUpdateUsersHasIndex(userList);
	}
}
